//
//  WritingPopView.m
//  TQY
//
//  Created by 甘世清 on 2024/11/7.
//

#import "WritingPopView.h"
#import "ReportMatePopView.h"
@implementation WritingPopView

- (void)SQ_UIViewForSelfView{
    self.backgroundColor = UIColor.whiteColor;
    self.layer.cornerRadius = 30;
    [self addSubview:self.jubaoBtn];
    [self.jubaoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self).offset(30);
        make.width.mas_equalTo(SCREEN_WIDETH - 40);
        make.height.mas_equalTo(54);
    }];
    
    UIView * lineView1 = [[UIView alloc]init];
    lineView1.backgroundColor = SQColorF5F5F5;
    [self addSubview:lineView1];
    [lineView1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self);
            make.height.mas_equalTo(2);
            make.bottom.equalTo(self.jubaoBtn.mas_bottom).offset(14);
    }];
    [self addSubview:self.pingbiBtn];
    [self.pingbiBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self.jubaoBtn.mas_bottom).offset(30);
        make.width.mas_equalTo(SCREEN_WIDETH - 40);
        make.height.mas_equalTo(54);
    }];
    UIView * lineView = [[UIView alloc]init];
    lineView.backgroundColor = SQColorF5F5F5;
    [self addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self);
            make.height.mas_equalTo(10);
            make.bottom.equalTo(self.mas_bottom).offset(-FootHeight-60);
    }];
    
    [self addSubview:self.quxiaoBtn];
    [self.quxiaoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.width.mas_equalTo(SCREEN_WIDETH - 40);
        make.bottom.equalTo(self.mas_bottom).offset(-10-FootHeight);
        make.height.mas_equalTo(44);
    }];
    WS(weakSelf);
    [self.jubaoBtn setTouchBlock:^(SQCustomButton * _Nonnull button) {
        [weakSelf SQ_reportPopView];
    }];
}

-(void)SQ_reportPopView{
    ReportMatePopView * vc = [[ReportMatePopView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDETH, SCREEN_HEIGHT-200)];
    vc.uid = self.uid;
    LSTPopView * pop = [LSTPopView initWithCustomView:vc
                                             parentView:nil
                                               popStyle:LSTPopStyleSmoothFromBottom dismissStyle:LSTDismissStyleSmoothToBottom];
    pop.hemStyle = LSTHemStyleBottom;
    pop.isStack = YES;
    [pop pop];
    LSTPopViewWK(pop)
    [pop setBgClickBlock:^{
        [wk_pop dismiss];
    }];
    [vc setReportMatetouchBlock:^{
        [wk_pop dismiss];
    }];
}

- (SQCustomButton *)quxiaoBtn{
    if (!_quxiaoBtn) {
        _quxiaoBtn = [[SQCustomButton alloc]initType:SQCustomButtonTopImageType imageSize:CGSizeMake(0, 0) midmargin:0];
        _quxiaoBtn.text = SQNSLocalString(@"取消");
        _quxiaoBtn.textColor = SQColor666666;
        _quxiaoBtn.font = FONT_REGULAR(14);
    }
    return _quxiaoBtn;
}


- (SQCustomButton *)jubaoBtn{
    if (!_jubaoBtn) {
        _jubaoBtn = [[SQCustomButton alloc]initType:SQCustomButtonTopImageType imageSize:CGSizeMake(0, 0) midmargin:0];
        _jubaoBtn.text = SQNSLocalString(@"举报");
        _jubaoBtn.textColor = SQColor3DA59D;
        _jubaoBtn.font = FONT_REGULAR(14);
        
    }
    return _jubaoBtn;
}
- (SQCustomButton *)pingbiBtn{
    if (!_pingbiBtn) {
        _pingbiBtn = [[SQCustomButton alloc]initType:SQCustomButtonTopImageType imageSize:CGSizeMake(0, 0) midmargin:0];
        _pingbiBtn.text = SQNSLocalString(@"屏蔽");
        _pingbiBtn.textColor = SQColor3DA59D;
        _pingbiBtn.font = FONT_REGULAR(14);
    }
    return _pingbiBtn;
}

@end
